package com.task.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author Huzz
 * @since 2021-12-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Chunk对象", description="")
@TableName("sys_file_chunk")
public class Chunk implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "块编号，从1开始", example = "123")
    private Integer chunkNumber;

    @ApiModelProperty(value = "块大小")
    private Long chunkSize;

    @ApiModelProperty(value = "当前块大小")
    @TableField("current_chunk")
    private Long currentChunkSize;

    @ApiModelProperty(value = "文件标识")
    private String identifier;

    @ApiModelProperty(value = "文件名")
    @TableField("file_name")
    private String filename;

    @ApiModelProperty(value = "相对路径")
    private String relativePath;

    @ApiModelProperty(value = "总块数")
    private Long totalChunks;

    @ApiModelProperty(value = "总大小", example = "123")
    private Integer totalSize;

    @ApiModelProperty(value = "文件类型")
    private String fileType;

    /**
     * 块内容
     */
    @TableField(exist = false)
    private MultipartFile upFile;

}
